login = {};
login.panel = new Ext.FormPanel({ 
    labelWidth: 80,
    frame: true, 
    title: 'Login to see tasks', 
    defaultType: 'textfield',
    monitorValid: true,
    items:[{ 
            fieldLabel: 'Username', 
            name: 'username', 
            allowBlank: false 
        },{ 
            fieldLabel: 'Password', 
            name: 'password', 
            inputType: 'password', 
            allowBlank: false 
        }],

    buttons:[{ 
            text: 'Login',
            formBind: true,  
            handler:function(){ 
                var values = login.panel.getForm().getValues();
                login.win.hide();
                tasks.login(values);
            } 
        }] 
});
 
login.win = new Ext.Window({
    layout: 'fit',
    width: 300,
    height: 150,
    closable: false,
    resizable: false,
    plain: true,
    border: false,
    items: [login.panel]
});

// END
